﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SampleDataTools
{
    public partial class DisplayArea : UserControl
    {
        public DisplayArea()
        {
            InitializeComponent();
        }

        private ValueItemConfig valueItemConfig;

        public void SetConfig(ValueItemConfig config)
        {
            valueItemConfig = config;
            label1.Text = config.Name;
        }

        public void Update(BuffData[] datas)
        {
            if (datas != null && datas.Length > valueItemConfig.DataIndex)
            {
                var data = datas[valueItemConfig.DataIndex];
                if (data != null)
                {
                    textBox1.Text = data.GetValueFormmat(valueItemConfig.Index);
                }
            }
        }

    }
}
